#include "cccc_mod_sinfile.h"
#include <iostream>

SingleFile::SingleFile()
{
	Fanins = new vector<ModularAtomic *> ();
	Fanouts = new vector<ModularAtomic *> ();
	violation = new vector<AViolation *> ();
	SteroType = "SingleFile";
	this->filename = "null";
	this->ModuleDef = "null";
	this->COMPONENT = "NO_DEFINE";
	this->MODULE = "NO_DEFINE";
	this->SUBMODULE = "NO_DEFINE";
	this->VISIBILITY= "NO_DEFINE";
}

SingleFile::SingleFile(string filename)
{
	char c;
	Fanins = new vector<ModularAtomic *> ();
	Fanouts = new vector<ModularAtomic *> ();
	violation = new vector<AViolation *> ();
	SteroType = "SingleFile";
	this->filename = filename;
	this->ModuleDef = this->filename;
	this->file = fopen(filename.c_str(), "r");
	if (this->file == NULL)
	{
		cout << "****File open error!!\n";
	}
	this->COMPONENT = "NO_DEFINE";
	this->MODULE = "NO_DEFINE";
	this->SUBMODULE = "NO_DEFINE";
	this->MODULE_DEF_LINE = 0;
	this->SUBMODULE_DEF_LINE = 0;
}

SingleFile::~SingleFile()
{

}

void SingleFile::setFilename(string _filename)
{
	filename = filename;
	ModuleDef = filename;

}

string SingleFile::getFilename()
{
	return filename;
}

void SingleFile::setFile(FILE * _file)
{
	file = file;
}

FILE * SingleFile::getFile()
{
	return file;
}

void SingleFile::setCOMPONENT(string component)
{
	COMPONENT = component;
}
string SingleFile::getCOMPONENT()
{
	return COMPONENT;
}
void SingleFile::setMODULE(string module)
{
	MODULE = module;
}
string SingleFile::getMODULE()
{
	return MODULE;
}
void SingleFile::setSUBMODULE(string submodule)
{
	this->SUBMODULE = submodule;
}
string SingleFile::getSUBMODULE()
{
	return this->SUBMODULE;
}

void SingleFile::setNumFunc(int numFunc)
{
	this->NUM_FUNCS = numFunc;
}

int SingleFile::getNumFunc()
{
	return this->NUM_FUNCS;
}

void SingleFile::setIncludes(vector<string> * in)
{
	this->includes = in;
}

vector<string> * SingleFile::getIncludes()
{
	return this->includes;
}

void SingleFile::printIncludes()
{
	int i;
	for (i = 0; i < this->includes->size(); i++)
	{
		cout << "includes are : " << (*includes)[i] << endl;
	}
}

void SingleFile::setVISIBILITY(string vis)
{
	this->VISIBILITY = vis;
}

string SingleFile::getVISIBILITY()
{
	return this->VISIBILITY;
}

void SingleFile::setMODULE_DEF_LINE(int line)
{
	this->MODULE_DEF_LINE = line;
}

int SingleFile::getMODULE_DEF_LINE()
{
	return this->MODULE_DEF_LINE;
}

void SingleFile::setSUBMODULE_DEF_LINE(int line)
{
	this->SUBMODULE_DEF_LINE = line;
}

int SingleFile::getSUBMODULE_DEF_LINE()
{
	return this->SUBMODULE_DEF_LINE;
}

void SingleFile::setIncludeLineVec(vector<int> * include_line)
{
	this->include_line = include_line;
}
vector<int> * SingleFile::getIncldueLineVec()
{
	return this->include_line;
}

void SingleFile::setLOC(int l){
	this->LOC=l;
}
